package sv.gob.mh.dgii.model;

// Generated Dec 10, 2007 4:52:21 PM by Hibernate Tools 3.2.0.beta7

import java.sql.Blob;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * CgCaso generated by hbm2java
 */
@Entity
@Table(name = "CG_CASO", schema = "UPET", uniqueConstraints = { @UniqueConstraint(columnNames = { "C_EXPEDIENTE" }) })
public class CgCaso implements java.io.Serializable {

	// Fields    

	/**
	 * 
	 */
	private static final long serialVersionUID = -4732192198974567337L;

	private Long ncaso;

	private CgEtapa cgEtapaActual;

	private CdDocumento cdDocumento;

	private TbCategCaso tbCategCaso;

	private CgCiclo cgCicloActual;

	private TbUnidad tbUnidadSolic;

	private CgOrigenExp cgOrigenExp;

	private EdDeclaraciones edDeclaraciones;

	private CgPrograma cgPrograma;

	private TbUnidad tbUnidad;

	private TbPrioridad tbPrioridad;

	private CgCiclo cgCiclo;

	private RcRuc rcRuc;

	private String cexpediente;

	private String dcaso;

	private String nitsolicitante;

	private Date fhrequerimiento;

	private Date fhasignacion;

	private Date fhrecepcion;

	private Date ffcompromiso;

	private Integer ntiempoAsig;

	private String munidadTiempo;

	private Long nruta;

	private String cusuario;

	private Date fhingreso;

	private Date fhmodificacion;

	private Date fhapertura;

	private String mstatus;

	private Integer bactiva;

	private Date fhcierreCaso;

	private Integer bdevuelto;

	private Blob xnota;


	private Set<CgObligXExp> cgObligXExps = new HashSet<CgObligXExp>(0);


	// Constructors

	/** default constructor */
	public CgCaso() {
	}

	/** minimal constructor */
	public CgCaso(Long ncaso, CgOrigenExp cgOrigenExp, TbPrioridad tbPrioridad,
			String dcaso, String cusuario, Date fhingreso, Date fhmodificacion,
			String mstatus, Integer bactiva, Integer bdevuelto) {
		this.ncaso = ncaso;
		this.cgOrigenExp = cgOrigenExp;
		this.tbPrioridad = tbPrioridad;
		this.dcaso = dcaso;
		this.cusuario = cusuario;
		this.fhingreso = fhingreso;
		this.fhmodificacion = fhmodificacion;
		this.mstatus = mstatus;
		this.bactiva = bactiva;
		this.bdevuelto = bdevuelto;
	}

	/** full constructor */
	public CgCaso(Long ncaso, CgEtapa cgEtapa, CdDocumento cdDocumento,
			TbCategCaso tbCategCaso, CgCiclo cgCicloByCCiclo,
			TbUnidad tbUnidadByCUnidadSolic, CgOrigenExp cgOrigenExp,
			EdDeclaraciones edDeclaraciones, CgPrograma cgPrograma,
			TbUnidad tbUnidadByCUnidad, TbPrioridad tbPrioridad,
			CgCiclo cgCicloByCCicloActual, RcRuc rcRuc, String cexpediente,
			String dcaso, String nitsolicitante, Date fhrequerimiento,
			Date fhasignacion, Date fhrecepcion, Date ffcompromiso,
			Integer ntiempoAsig, String munidadTiempo, Long nruta,
			String cusuario, Date fhingreso, Date fhmodificacion,
			Date fhapertura, String mstatus, Integer bactiva,
			Date fhcierreCaso, Integer bdevuelto, Blob xnota,
			Set<CgObligXExp> cgObligXExps) {
		this.ncaso = ncaso;
		this.cgEtapaActual = cgEtapa;
		this.cdDocumento = cdDocumento;
		this.tbCategCaso = tbCategCaso;
		this.cgCicloActual = cgCicloByCCiclo;
		this.tbUnidadSolic = tbUnidadByCUnidadSolic;
		this.cgOrigenExp = cgOrigenExp;
		this.edDeclaraciones = edDeclaraciones;
		this.cgPrograma = cgPrograma;
		this.tbUnidad = tbUnidadByCUnidad;
		this.tbPrioridad = tbPrioridad;
		this.cgCiclo = cgCicloByCCicloActual;
		this.rcRuc = rcRuc;
		this.cexpediente = cexpediente;
		this.dcaso = dcaso;
		this.nitsolicitante = nitsolicitante;
		this.fhrequerimiento = fhrequerimiento;
		this.fhasignacion = fhasignacion;
		this.fhrecepcion = fhrecepcion;
		this.ffcompromiso = ffcompromiso;
		this.ntiempoAsig = ntiempoAsig;
		this.munidadTiempo = munidadTiempo;
		this.nruta = nruta;
		this.cusuario = cusuario;
		this.fhingreso = fhingreso;
		this.fhmodificacion = fhmodificacion;
		this.fhapertura = fhapertura;
		this.mstatus = mstatus;
		this.bactiva = bactiva;
		this.fhcierreCaso = fhcierreCaso;
		this.bdevuelto = bdevuelto;
		this.xnota = xnota;
		this.cgObligXExps = cgObligXExps;
	}

	// Property accessors
	@Id
	@Column(name = "N_CASO", unique = true, nullable = false, insertable = true, updatable = true, precision = 10, scale = 0)
	public Long getNcaso() {
		return this.ncaso;
	}

	public void setNcaso(Long ncaso) {
		this.ncaso = ncaso;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumn(name = "C_ETAPA_ACTUAL", unique = false, nullable = true, insertable = true, updatable = true)
	public CgEtapa getCgEtapaActual() {
		return this.cgEtapaActual;
	}

	public void setCgEtapaActual(CgEtapa cgEtapa) {
		this.cgEtapaActual = cgEtapa;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumn(name = "N_DOCUMENTO", unique = false, nullable = true, insertable = true, updatable = true)
	public CdDocumento getCdDocumento() {
		return this.cdDocumento;
	}

	public void setCdDocumento(CdDocumento cdDocumento) {
		this.cdDocumento = cdDocumento;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "C_CATEGORIA", unique = false, nullable = true, insertable = true, updatable = true)
	public TbCategCaso getTbCategCaso() {
		return this.tbCategCaso;
	}

	public void setTbCategCaso(TbCategCaso tbCategCaso) {
		this.tbCategCaso = tbCategCaso;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumn(name = "C_CICLO", unique = false, nullable = true, insertable = true, updatable = true)
	public CgCiclo getCgCicloActual() {
		return this.cgCicloActual;
	}

	public void setCgCicloActual(CgCiclo cgCicloByCCiclo) {
		this.cgCicloActual = cgCicloByCCiclo;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumn(name = "C_UNIDAD_SOLIC", unique = false, nullable = true, insertable = true, updatable = true)
	public TbUnidad getTbUnidadSolic() {
		return this.tbUnidadSolic;
	}

	public void setTbUnidadSolic(TbUnidad tbUnidadByCUnidadSolic) {
		this.tbUnidadSolic = tbUnidadByCUnidadSolic;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumn(name = "C_ORIGEN", unique = false, nullable = false, insertable = true, updatable = true)
	public CgOrigenExp getCgOrigenExp() {
		return this.cgOrigenExp;
	}

	public void setCgOrigenExp(CgOrigenExp cgOrigenExp) {
		this.cgOrigenExp = cgOrigenExp;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumn(name = "I_INDICE", unique = false, nullable = true, insertable = true, updatable = true)
	public EdDeclaraciones getEdDeclaraciones() {
		return this.edDeclaraciones;
	}

	public void setEdDeclaraciones(EdDeclaraciones edDeclaraciones) {
		this.edDeclaraciones = edDeclaraciones;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "C_PROGRAMA", unique = false, nullable = true, insertable = true, updatable = true)
	public CgPrograma getCgPrograma() {
		return this.cgPrograma;
	}

	public void setCgPrograma(CgPrograma cgPrograma) {
		this.cgPrograma = cgPrograma;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumn(name = "C_UNIDAD", unique = false, nullable = true, insertable = true, updatable = true)
	public TbUnidad getTbUnidad() {
		return this.tbUnidad;
	}

	public void setTbUnidad(TbUnidad tbUnidadByCUnidad) {
		this.tbUnidad = tbUnidadByCUnidad;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumn(name = "C_PRIORIDAD", unique = false, nullable = false, insertable = true, updatable = true)
	public TbPrioridad getTbPrioridad() {
		return this.tbPrioridad;
	}

	public void setTbPrioridad(TbPrioridad tbPrioridad) {
		this.tbPrioridad = tbPrioridad;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "C_CICLO_ACTUAL", unique = false, nullable = true, insertable = true, updatable = true)
	public CgCiclo getCgCiclo() {
		return this.cgCiclo;
	}

	public void setCgCiclo(CgCiclo cgCicloByCCicloActual) {
		this.cgCiclo = cgCicloByCCicloActual;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumn(name = "NIT", unique = false, nullable = true, insertable = true, updatable = true)
	public RcRuc getRcRuc() {
		return this.rcRuc;
	}

	public void setRcRuc(RcRuc rcRuc) {
		this.rcRuc = rcRuc;
	}

	@Column(name = "C_EXPEDIENTE", unique = true, nullable = true, insertable = true, updatable = true, length = 20)
	public String getCexpediente() {
		return this.cexpediente;
	}

	public void setCexpediente(String cexpediente) {
		this.cexpediente = cexpediente;
	}

	@Column(name = "D_CASO", unique = false, nullable = false, insertable = true, updatable = true, length = 60)
	public String getDcaso() {
		return this.dcaso;
	}

	public void setDcaso(String dcaso) {
		this.dcaso = dcaso;
	}

	@Column(name = "NIT_SOLICITANTE", unique = false, nullable = true, insertable = true, updatable = true, length = 14)
	public String getNitsolicitante() {
		return this.nitsolicitante;
	}

	public void setNitsolicitante(String nitsolicitante) {
		this.nitsolicitante = nitsolicitante;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_REQUERIMIENTO", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public Date getFhrequerimiento() {
		return this.fhrequerimiento;
	}

	public void setFhrequerimiento(Date fhrequerimiento) {
		this.fhrequerimiento = fhrequerimiento;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_ASIGNACION", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public Date getFhasignacion() {
		return this.fhasignacion;
	}

	public void setFhasignacion(Date fhasignacion) {
		this.fhasignacion = fhasignacion;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_RECEPCION", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public Date getFhrecepcion() {
		return this.fhrecepcion;
	}

	public void setFhrecepcion(Date fhrecepcion) {
		this.fhrecepcion = fhrecepcion;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FF_COMPROMISO", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public Date getFfcompromiso() {
		return this.ffcompromiso;
	}

	public void setFfcompromiso(Date ffcompromiso) {
		this.ffcompromiso = ffcompromiso;
	}

	@Column(name = "N_TIEMPO_ASIG", unique = false, nullable = true, insertable = true, updatable = true, precision = 5, scale = 0)
	public Integer getNtiempoAsig() {
		return this.ntiempoAsig;
	}

	public void setNtiempoAsig(Integer ntiempoAsig) {
		this.ntiempoAsig = ntiempoAsig;
	}

	@Column(name = "M_UNIDAD_TIEMPO", unique = false, nullable = true, insertable = true, updatable = true, length = 1)
	public String getMunidadTiempo() {
		return this.munidadTiempo;
	}

	public void setMunidadTiempo(String munidadTiempo) {
		this.munidadTiempo = munidadTiempo;
	}

	@Column(name = "N_RUTA", unique = false, nullable = true, insertable = true, updatable = true, precision = 10, scale = 0)
	public Long getNruta() {
		return this.nruta;
	}

	public void setNruta(Long nruta) {
		this.nruta = nruta;
	}

	@Column(name = "C_USUARIO", unique = false, nullable = false, insertable = true, updatable = true, length = 30)
	public String getCusuario() {
		return this.cusuario;
	}

	public void setCusuario(String cusuario) {
		this.cusuario = cusuario;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_INGRESO", unique = false, nullable = false, insertable = true, updatable = true, length = 7)
	public Date getFhingreso() {
		return this.fhingreso;
	}

	public void setFhingreso(Date fhingreso) {
		this.fhingreso = fhingreso;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_MODIFICACION", unique = false, nullable = false, insertable = true, updatable = true, length = 7)
	public Date getFhmodificacion() {
		return this.fhmodificacion;
	}

	public void setFhmodificacion(Date fhmodificacion) {
		this.fhmodificacion = fhmodificacion;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_APERTURA", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public Date getFhapertura() {
		return this.fhapertura;
	}

	public void setFhapertura(Date fhapertura) {
		this.fhapertura = fhapertura;
	}

	@Column(name = "M_STATUS", unique = false, nullable = false, insertable = true, updatable = true, length = 1)
	public String getMstatus() {
		return this.mstatus;
	}

	public void setMstatus(String mstatus) {
		this.mstatus = mstatus;
	}

	@Column(name = "B_ACTIVA", unique = false, nullable = false, insertable = true, updatable = true, precision = 1, scale = 0)
	public Integer getBactiva() {
		return this.bactiva;
	}

	public void setBactiva(Integer bactiva) {
		this.bactiva = bactiva;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_CIERRE_CASO", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public Date getFhcierreCaso() {
		return this.fhcierreCaso;
	}

	public void setFhcierreCaso(Date fhcierreCaso) {
		this.fhcierreCaso = fhcierreCaso;
	}

	@Column(name = "B_DEVUELTO", unique = false, nullable = false, insertable = true, updatable = true, precision = 1, scale = 0)
	public Integer getBdevuelto() {
		return this.bdevuelto;
	}

	public void setBdevuelto(Integer bdevuelto) {
		this.bdevuelto = bdevuelto;
	}

	@Column(name = "X_NOTA", unique = false, nullable = true, insertable = true, updatable = true)
	public Blob getXnota() {
		return this.xnota;
	}

	public void setXnota(Blob xnota) {
		this.xnota = xnota;
	}

	@OneToMany( fetch = FetchType.EAGER, mappedBy = "cgCaso")
	public Set<CgObligXExp> getCgObligXExps() {
		return this.cgObligXExps;
	}

	public void setCgObligXExps(Set<CgObligXExp> cgObligXExps) {
		this.cgObligXExps = cgObligXExps;
	}

}
